package com.example.jcextend.controller;

import com.example.jcextend.utils.ExportWordUtil;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
public class TestController {

    //导出文件
    @GetMapping("/textExport")
    public void textExport() throws Exception {
        Map<String,String> dataMap=new HashMap<>();
        dataMap.put("name","经典鸡翅");
        dataMap.put("auditName","李思亮");

        //我们这里直接写了,就不用像黑马那样返回了
        ExportWordUtil.exportWord(dataMap,"导出文件","wordTem.ftl");
    }
}
